<!doctype html>
<html>
<head>
  <title>Modify Rotation</title>
  {{.FeedbackButton}}
</head>
<body>
<script src="/static/dist/bundle.js"></script>
<nav-bar page="rota" logoutURL="{{.LogoutURL}}"></nav-bar>

<h2>Rotations you manage </h2>

{{if not .Rotas}}
<i>No rotas managed</i>
{{end}}

{{with .Rotas}}
<h3>Rota table</h3>
<table class="table">
  <thead>
    <tr>
      <th>Name</th>
     </tr>
  </thead>
  <tbody>
  {{range $c := .}}
     <tr>
       <td>{{$c.Config.Name}}</td>
       <td>
         <form action="modifyrota">
            <button type="submit" name="name" value="{{$c.Config.Name}}">Modify</button>
         </form>
       </td>
       <td>
         <form action="manageshifts">
            <button type="submit" name="name" value="{{$c.Config.Name}}">Shifts</button>
         </form>
       </td>
       <td>
         <form action="deleterota" method="post" onclick="return confirm('Are you sure?')">
            <button type="submit" name="name" value="{{$c.Config.Name}}">Delete</button>
         </form>
       </td>
       <td>
         <form action="enabledisable" method="post">
           <button type="submit" name="name" value="{{$c.Config.Name}}">
             {{if eq $c.Config.Enabled true}}Disable{{else}}Enable{{end}}
           </button>
         </form>
       </td>
     </tr>
   {{end}}
  </tbody>
</table>
{{end}}

<br>
<br>

<a href="createrota">Create new rotation</a><br>

</body>
</html>
